medata here is the Mediterranean dataframe with the following changes:

Some more work needed:

Location and Max Temp

p1 <- ggplot(medata, aes(x = medata$lon, y = medata$lat)) +
  geom_jitter(aes(colour = medata$tmax), show.legend = T) +
  xlab("Longitude") + ylab("Latitude") +
  scale_color_gradient(name = "Max Annual Temp", low = "#3c9ab1", high = "#f22300", na.value = "#899da4")

ggplotly(p1)

NA checks

all NAs

medata_na <- subset(medata, is.na(medata))
nrow(medata_na)
## [1] 124692

tmax and tmin

temp_na <- subset(medata, is.na(medata$tmax))
nrow(temp_na)
## [1] 2540

location

loc_na <- subset(medata, is.na(medata$lat))
nrow(loc_na)
## [1] 996

All of the above can be printed as tables, they’re just extremely long.

Location and MPAs

medata$protection <- ifelse(test = medata$protection == 1, yes = TRUE, no = FALSE) # convert to logical
p2 <- ggplot(medata, aes(x = medata$lon, y = medata$lat)) +
  geom_jitter(aes(colour = medata$protection), show.legend = T, alpha = 0.2) +
  xlab("Longitude") + ylab("Latitude") +
  scale_color_discrete(name = "MPAs", na.value = "snow4")

ggplotly(p2)

So, so far we